home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / patches / pgs3f.lha / 3.0fUpdate / Macros.LHA / ReplaceGraphic.rexx < prev    next >
OS/2 REXX Batch file  |  1994-09-20  |  3KB  |  59 lines

  1. /* $VER: ReplaceGraphic.rexx 1.0 (02.9.94)
  2.    Copyright 1994 Soft-Logik Publishing Corporation
  3.    May not be distributed without Soft-Logik Publishing Corporation's express written permission */
  4.  
  5. OPTIONS RESULTS
  6. TRACE OFF
  7.  
  8. /* Make sure rexx support is opened */
  9. IF ~SHOW('L','rexxsupport.library') THEN
  10.    CALL ADDLIB('rexxsupport.library',0,-30)
  11.  
  12. ADDRESS 'PAGESTREAM'
  13.  
  14. /* Check and see if a box or graphic is selected */
  15. 'getobject type objtype'
  16. objnum=result
  17. /* object types: 12:picture, 5:box, 2:drawing, 13:eps */
  18. if objtype=12 | objtype=5 | objtype=2 | objtype=13 then do
  19.     'refresh wait'
  20.     if objtype=12 then getpicture position pstem rotation rstem about rstem contentoffset cstem contentscale cstem frame fflag constrain cflag print pflag
  21.     if objtype=5 then getbox position pstem rotation rstem about rstem constrain cflag print pflag
  22.     if objtype=2 then getdrawing position pstem rotation rstem about rstem contentoffset cstem contentscale cstem frame fflag constrain cflag print pflag
  23.     if objtype=13 then geteps position pstem rotation rstem about rstem contentoffset cstem contentscale cstem frame fflag constrain cflag print pflag
  24.     gettextwrap region wmode wrap wtype standoff wstem objectid objnum
  25.     placegraphic status
  26.     if rc~=0 then signal cancel
  27.     'getobject type nobjtype'
  28.     nobjnum=result
  29.     pstring=position' 'pstem.left' 'pstem.top' 'pstem.right' 'pstem.bottom' skew 'rstem.slant' 'rstem.twist
  30.     if fflag=ON then pstring=pstring' framed contentoffset 'cstem.x' 'cstem.y' contentscale 'cstem.h' 'cstem.v
  31.     if rstem.mode=POINT then pstring=pstring' about 'rstem.x' 'rstem.y
  32.     if cflag=ON then pstring=pstring' constrain'
  33.     if pflag=OFF then pstring=pstring' noprint'
  34.     if nobjtype=12 then 'editpicture 'pstring
  35.     if nobjtype=2 then 'editdrawing 'pstring
  36.     if nobjtype=13 then 'editeps 'pstring
  37.     if wtype~=NOWRAP then settextwrap wmode wtype standoff wstem.x wstem.y
  38.     deleteobject objectid objnum
  39.     selectobject objectid nobjnum
  40.     'refresh continue'
  41. end
  42. else do
  43.     allocarexxrequester '"Replace Graphic Error!"' 540 61
  44.     reqhandle=result
  45.     addarexxgadget reqhandle EXIT 235 44 70 label "_Exit"
  46.         Exithandle=result
  47.     addarexxgadget reqhandle TEXT 8 10 520 border none string "'A box or graphic must be selected to replace with a new graphic.'"
  48.     addarexxgadget reqhandle TEXT 8 22 520 border none string "'Select one box or graphic and choose Replace Graphic again.'"
  49.     doarexxrequester reqhandle
  50.     freearexxrequester reqhandle
  51.     EXIT
  52. end
  53. EXIT
  54.  
  55. CANCEL:
  56. selectobject objectid objnum
  57. 'refresh continue'
  58. EXIT
  59.